aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
diff options
context:
space:
mode:
authorMert Demir <mertd@users.noreply.github.com>2024-02-05 02:23:11 +0900
committerGitHub <noreply@github.com>2024-02-04 12:23:11 -0500
commitfb49fb596a56955ca70eac9da47d2826299469e1 (patch)
tree71dd092faf01d37b35a8015e3cfda494ddc7b99e /src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
parent10fd69404a69b15d5c0888d9382663f324455ec0 (diff)
Automatic category from expense title (#80)
* environment variable * random category draft * get category from ai * input limit and documentation * use watch * use field.name * prettier * presigned upload, readme warning, category to string util * prettier * check whether feature is enabled * use process.env * improved prompt to return id only * remove console.debug * show loader * share class name * prettier * use template literals * rename format util * prettier
Diffstat (limited to 'src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx')
-rw-r--r--src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx b/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
index d3f2bcf..b6df672 100644
--- a/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
+++ b/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
@@ -29,7 +29,7 @@ import { useMediaQuery } from '@/lib/hooks'
import { formatExpenseDate } from '@/lib/utils'
import { Category } from '@prisma/client'
import { ChevronRight, FileQuestion, Loader2, Receipt } from 'lucide-react'
-import { getImageData, useS3Upload } from 'next-s3-upload'
+import { getImageData, usePresignedUpload } from 'next-s3-upload'
import Image from 'next/image'
import { useRouter } from 'next/navigation'
import { PropsWithChildren, ReactNode, useState } from 'react'
@@ -46,7 +46,7 @@ export function CreateFromReceiptButton({
categories,
}: Props) {
const [pending, setPending] = useState(false)
- const { uploadToS3, FileInput, openFileDialog } = useS3Upload()
+ const { uploadToS3, FileInput, openFileDialog } = usePresignedUpload()
const { toast } = useToast()
const router = useRouter()
const [receiptInfo, setReceiptInfo] = useState<